package com.ultrawise.survey.module.surevybase.dao;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.stereotype.Repository;

import com.ultrawise.survey.core.base.BaseDao;
import com.ultrawise.survey.module.surevybase.vo.TSurveyInfoQuestion;


/**
 * A data access object (DAO) providing persistence and search support for
 * TSurveyInfoQuestion entities. Transaction control of the save(), update() and
 * delete() operations can directly support Spring container-managed
 * transactions or they can be augmented to handle user-managed Spring
 * transactions. Each of these methods provides additional information for how
 * to configure it for the desired type of transaction control.
 * 
 * @see AbstractTSurveyInfoQuestion.dao.TSurveyInfoQuestion
 * @author MyEclipse Persistence Tools
 */
@SuppressWarnings("all")
@Repository("tSurveyInfoQuestionDAO")
public class TSurveyInfoQuestionDAO extends BaseDao {
	private static final Logger log = LoggerFactory.getLogger(TSurveyInfoQuestionDAO.class);

	/*****
	 * 
	 * @param syid
	 * @return
	 */
	public List<TSurveyInfoQuestion> getQuestionBysyid(Integer syid) {
		String sql = "select *  from t_survey_info_question where 1=1";
		if (syid != null) {
			sql +=" and SY_ID = ?";
			sql +=" order by qn_order";
			return 	getJdbcTemplate().query(sql,new BeanPropertyRowMapper(TSurveyInfoQuestion.class),syid);
		}else{
			return 	null;
		}
	}
}